package com.blb.thread;

public class PriorityDemo {
    public static void main(String[] args) {

        Thread thread1 = new Thread(() -> {
            for (int i = 0; i < 10; i++) {
                System.out.println(Thread.currentThread().getName() + "------>" + i);
            }
        });
        thread1.setName("张三");
        thread1.setPriority(Thread.MIN_PRIORITY);
        Thread thread2 = new Thread(() -> {
            for (int i = 0; i < 10; i++) {
                System.out.println(Thread.currentThread().getName() + "------>" + i);
            }
        });
        thread2.setName("李四");
        thread2.setPriority(Thread.MAX_PRIORITY);
        thread1.start();
        thread2.start();




    }
}
